<template>
  <div id="applicant">
    <div class="server-name">
        <!-- <img class="icon" src="../assets/img/icon_server.png" alt="定位图标"> -->
        <span>{{HIGHWAYPROINST.SERVERPART_NAME}}</span>
        <span class="server-state">调价通知</span>
    </div>
    <div class="operation">
        <div class="list-item">
            <!-- <img class="icon" src="../assets/img/icon_yewu.png" alt="业务图标"> -->
            <!-- <span class="item-title">业务名称</span> -->
            <span class="note">{{HIGHWAYPROINST.DEPT_NAME | deptNameF}}</span>
            <!-- <a class="details" @click="detailPopup = true">查看详情</a> -->
        </div>
        <div class="list-item">
            <!-- <img class="icon" src="../assets/img/icon_applicant.png" alt="申请人"> -->
            <span class="item-title">通知人员：</span>
            <span>{{HIGHWAYPROINST.STAFF_NAME | deptNameF}}</span>
        </div>
        <div class="list-item">
            <!-- <img class="icon time" src="../assets/img/icon_applicant_time.png" alt="申请时间"> -->
            <span class="item-title">通知时间：</span>
            <span>{{HIGHWAYPROINST.HIGHWAYPROINST_ENDDATE | deptNameF}}</span>
        </div>          
          <div class="list-item" v-show="false">
            <!-- <img class="icon" src="../assets/img/icon_applicant.png" alt="申请人"> -->
            <span class="item-title">审核人员：</span>
            <span>{{HIGHWAYPROINST.APPROVED_STAFF | deptNameF}}</span>
        </div>
        <div class="list-item" v-show="false">
            <!-- <img class="icon time" src="../assets/img/icon_applicant_time.png" alt="申请时间"> -->
            <span class="item-title">审核时间：</span>
            <span>{{HIGHWAYPROINST.CHECK_DATE | deptNameF}}</span>
        </div>          
    </div>
    <!-- 详情 -->
    <mt-popup
        v-model="detailPopup"
        position="right"
        modal="false">
    <div class="detail-box">
        <span class="close" @click="detailPopup = false">关闭</span>
        <div class="summary">有 <span class="summary-num">{{goods.size}}</span> 件商品价格发生变动</div>
        <div class="goods-lists" ref="wrapperc" :style="{ height: wrapperHeightc + 'px' }">
            <ul
				infinite-scroll-disabled="loading"
				infinite-scroll-distance="10"
				infinite-scroll-immediate-check="true">
                <li class="goods-item" v-for="(item,i) in goods.goods" :key="i"><span class="number">{{i+1}}.</span><span class="goods-name">{{item.COMMODITY_NAME}}调整</span></li>
            </ul>
        </div>
    </div>
    </mt-popup>
  </div>
</template>
<script>
export default {
  name: "ApplicantOperation",
  props: {
    message: String,
    goods: {
      type: Object
    }
  },
  data() {
    return {
      // 请求参数
      queryCode: "EA665579A4BAFE4C",
      HIGHWAYPROINST: "",
      detailPopup: false,
      changeCell: 0,
      wrapperHeightc: 0
    };
  },
  methods: {
    getMsg() {
      this.queryCode = this.message;
      // console.log(this.goods)
      this.changeCell = this.goods.length;
      this.$http({
        url:
          "http://mall.eshangtech.com:8010/MobileServicePlatform/Handler/handler_ajax.ashx?",
        params: {
          action_type: "GetApproveInfo",
          action_data: this.queryCode
        }
      }).then(res => {
        // console.log(res);
        if (res.status === 200 && res.data.HIGHWAYPROINST.length !== 0) {
          this.HIGHWAYPROINST = res.data.HIGHWAYPROINST[0];
        } else {
        }
      });
    }
  },
  created() {
    this.getMsg();
  },
  mounted() {
    this.wrapperHeightc = document.documentElement.clientHeight - 45;
  }
};
</script>
<style scoped>
#applicant {
  background: #ffffff;
  color: #686868;
  font-size: 11px;
}

.goods-lists {
  margin-top: 0.5rem;
  overflow: auto;
}
.goods-item {
  display: flex;
  align-items: center;
  color: #323232;
  height: 1.375rem;
  padding-left: 1rem;
  background: #fff;
  border-bottom: 1px solid #d9d9d9;
}
.number {
  font-size: 16px;
  margin-right: 5px;
  flex: 2;
}
.goods-name {
  flex: 30;
}
.summary {
  display: flex;
  height: 2rem;
  background: #fff;
  color: #323232;
  justify-content: center;
  align-items: center;
}
.close {
  display: block;
  width: 3rem;
  height: 2rem;
  text-align: center;
  line-height: 2rem;
  position: absolute;
  top: 0;
  right: 0;
}
.summary-num {
  margin: 0 0.2rem;
  color: #f48e39;
  font-size: 12px;
}
.mint-popup-right {
  width: 100%;
  height: 100%;
  background: #f2f2f2;
}
.detail-box {
}
.server-name {
  display: flex;
  text-align: left;
  max-height: 35px;
  color: #464646;
  padding-left: 1rem;
  padding-top: 0.7rem;
}
.server-name .icon {
  width: 16px;
}
.icon {
  width: 12px;
  margin-right: 7.5px;
}
.time {
  /* margin-left: .5rem; */
}
.operation {
  padding-left: 1rem;
  padding-bottom: 10px;
}
.list-item {
  display: flex;
  align-items: center;
  padding: 5.5px 0;
}
.item-title {
  margin-right: 4px;
}
.details {
  font-size: 10px;
  color: #f6903b;
}
.note {
  display: inline-block;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 15px;
  font-size: 20px;
  color: #ec9061;
}
.server-state{
    display: inline-block;
    text-align: right;
    margin-left: 11rem;
}
@media only screen and (min-device-width: 320px) and (max-device-width: 330px) {
  .operation {
    padding-left: 0.2rem;
  }
  .time {
    margin-left: 5px;
  }
  .icon {
    margin-right: 5px;
  }
}
</style>
